package com.zt.ftphelper.model;

import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;

public class ServerItem {
    private Integer id;
    private StringProperty ip = new SimpleStringProperty();
    private StringProperty port = new SimpleStringProperty();
    private StringProperty userName = new SimpleStringProperty();
    private StringProperty password = new SimpleStringProperty();
    private StringProperty deployPath = new SimpleStringProperty();

    public ServerItem(Integer id,String ip, String port, String userName, String password, String deployPath) {
        this.id=id;
        setIp(ip);
        setPort(port);
        setUserName(userName);
        setPassword(password);
        setDeployPath(deployPath);
    }

    public ServerItem() {
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getIp() {
        return ip.get();
    }

    public StringProperty ipProperty() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip.set(ip);
    }

    public String getPort() {
        return port.get();
    }

    public StringProperty portProperty() {
        return port;
    }

    public void setPort(String port) {
        this.port.set(port);
    }

    public String getUserName() {
        return userName.get();
    }

    public StringProperty userNameProperty() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName.set(userName);
    }

    public String getPassword() {
        return password.get();
    }

    public StringProperty passwordProperty() {
        return password;
    }

    public void setPassword(String password) {
        this.password.set(password);
    }

    public String getDeployPath() {
        return deployPath.get();
    }

    public StringProperty deployPathProperty() {
        return deployPath;
    }

    public void setDeployPath(String deployPath) {
        this.deployPath.set(deployPath);
    }

    @Override
    public String toString() {
        String addr = "ftp://"+getUserName()+":"+getPassword()+"@"
                +getIp()+":"+getPort()+"|"+getDeployPath();

        return addr;
    }
}
